package com.shilan.administrator.qintfm.fragment.tabhostFragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.shilan.administrator.qintfm.R;
import com.shilan.administrator.qintfm.fragment.BaseFragment;
import com.shilan.administrator.qintfm.fragment.MusicLIstFragment;
import com.shilan.administrator.qintfm.fragment.TimeSettingFragment;

/**
 * Created by dllo on 16/1/12.
 */
public class MineFragment extends BaseFragment implements View.OnClickListener {
    private RelativeLayout localmusicRl,timeSetting;
    private FragmentManager fm ;
    private FragmentTransaction ft;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_mine,null);

        localmusicRl = (RelativeLayout) view.findViewById(R.id.localmusic_rl);
        localmusicRl.setOnClickListener(this);

        timeSetting = (RelativeLayout) view.findViewById(R.id.timeSetting);
        timeSetting.setOnClickListener(this);
        return view;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.localmusic_rl:
//                fm = getActivity().getSupportFragmentManager();
//                ft = fm.beginTransaction();
//                ft.replace(R.id.mainview_framelayout,new MusicLIstFragment()).addToBackStack(null);
//
//                ft.commit();
                goToNext(new MusicLIstFragment());
                break;
            case R.id.timeSetting:
                goToNext(new TimeSettingFragment());
                break;

        }
    }
}
